﻿//-----------------------------------------------------------------------
// <copyright file="MachineEntity.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Model
{
    using System;

    using CodePlex.Diagnostics.Contracts;

    /// <summary>
    /// Represents a machine upon which an exception is thrown or a log entry is written.
    /// </summary>
    public sealed partial class MachineEntity
    {
        #region public MachineEntity()

        /// <summary>
        /// Initializes a new instance of the <see cref="T:MachineEntity"/> class.
        /// </summary>
        public MachineEntity()
        {
        }

        #endregion

        #region public MachineEntity(MachineDataContract machine)

        /// <summary>
        /// Initializes a new instance of the <see cref="T:MachineEntity"/> class.
        /// </summary>
        /// <param name="machine">An instance of the <see cref="T:MachineDataContract"/> class to be used to construct an instance of the <see cref="T:ProcessEntity"/> class.</param>
        public MachineEntity(MachineDataContract machine)
        {
            this.MachineName = machine.MachineName;

            this.ProcessorCount = machine.ProcessorCount;

            this.MachineIPAddress = machine.IPAddress;

            this.OperatingSystem = machine.OperatingSystem;

            this.InstalledMemory = machine.InstalledMemory;

            this.InstalledMemorySpeed = machine.InstalledMemorySpeed;
        }

        #endregion
    }
}
